<template>
    <div>
        <a-row style="width: 100%;" :gutter="5">
            <a-button type="primary" @click="handleShouYaJin">
                收押金
            </a-button>
            <a-button type="primary">
                收押金
            </a-button>
            <a-button type="primary">
                收押金
            </a-button>
        </a-row>
        <a-table ref="table" size="small" bordered rowKey="roomRegisterCode" class="j-table-force-nowrap"
            :scroll="{ y: 250 }" :columns="columns" :dataSource="dataSource" :pagination="ipagination"
            :loading="loading" @change="handleTableChange">
            <!--  :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }" -->
            <template slot="htmlSlot" slot-scope="text">
                <div v-html="text"></div>
            </template>
        </a-table>
        <ShouYaJinModal ref="shouYaJinModal" />
    </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ShouYaJinModal from './ShouYaJinModules/ShouYaJinModal'

export default {
    name: 'ShouYinChuLi',
    mixins: [JeecgListMixin],
    components: {
        ShouYaJinModal
    },
    data() {
        return {
            description: '收银处理',
            // 表头
            columns: [
                {
                    title: '#',
                    dataIndex: '',
                    key: 'rowIndex',
                    width: 60,
                    align: "center",
                    customRender: function (t, r, index) {
                        return parseInt(index) + 1;
                    }
                },
                {
                    title: '登记编码',
                    align: "center",
                    dataIndex: 'roomRegisterCode',
                    width: 200,
                },
                {
                    title: '房间号',
                    align: "center",
                    dataIndex: 'roomCode',
                    width: 100,
                },
                {
                    title: '抵店时间',
                    align: "center",
                    dataIndex: 'dateArrival',
                    width: 180,
                },
                {
                    title: '预离店时间',
                    align: "center",
                    dataIndex: 'dateDeparture',
                    width: 180,
                },
                {
                    title: '房晚数',
                    align: "center",
                    dataIndex: 'dateNum',
                    width: 100,
                },
                {
                    title: '房价',
                    align: "center",
                    dataIndex: 'roomPrice',
                    width: 100,
                },
                {
                    title: '早餐份数',
                    align: "center",
                    dataIndex: 'breakfastNum',
                    width: 100,
                },
                {
                    title: '客人账号',
                    align: "center",
                    dataIndex: 'accountCode',
                    width: 220,
                },
                {
                    title: '客人姓名',
                    align: "center",
                    dataIndex: 'guestName',
                    width: 220,
                },
                {
                    title: '余额',
                    align: "center",
                    dataIndex: 'amount',
                },
            ],
            url: {
                list: "/room/roomReceiptInfo/list",
            },
            isorter: {
                column: 'roomRegisterCode',
                order: 'desc',
            },
            ipagination: {
                current: 1,
                pageSize: 5,
                pageSizeOptions: ['5', '10', '20', '30'],
                showTotal: (total, range) => {
                    return range[0] + "-" + range[1] + " 共" + total + "条"
                },
                showQuickJumper: true,
                showSizeChanger: true,
                total: 0
            },
        }

    },
    methods: {
        handleShouYaJin() {
            this.$refs.shouYaJinModal.add()
        }
    }
}
</script>

<style scoped></style>